Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

poetryPlugins.poetry-plugin-poeblix: init at 0.10.0 #295651

Merged
merged 2 commits into from Mar 27, 2024

Conversation

hennk
Copy link
Contributor

@hennk hennk commented Mar 13, 2024

Description of changes

https://github.com/spoorn/poeblix

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 馃憤 reaction to pull requests you find important.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/3638

@SuperSandro2000 SuperSandro2000 merged commit 55c36ec into NixOS:master Mar 27, 2024
24 checks passed
@hennk hennk deleted the poetry-plugin-poeblix branch March 28, 2024 20:27
Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why weren't the poetry maintainers pinged?

};

postPatch = ''
sed -i '/poetry =/d' pyproject.toml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sed -i '/poetry =/d' pyproject.toml

Add poetry to buildInputs.

poetry-core
];

doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Please run the tests.


meta = with lib; {
changelog = "https://github.com/spoorn/poeblix/releases/tag/${src.rev}";
description = "Poetry Plugin that adds various features that extend the poetry command such as building wheel files with locked dependencies, and validations of wheel/docker containers";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too long

}:

buildPythonPackage rec {
pname = "poetry-plugin-poeblix";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pname = "poetry-plugin-poeblix";
pname = "poeblix";

That's what it's called on PyPI.

@@ -30,6 +30,7 @@ let
poetry-audit-plugin = callPackage ./plugins/poetry-audit-plugin.nix { };
poetry-plugin-export = callPackage ./plugins/poetry-plugin-export.nix { };
poetry-plugin-up = callPackage ./plugins/poetry-plugin-up.nix { };
poetry-plugin-poeblix = callPackage ./plugins/poetry-plugin-poeblix.nix { };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
poetry-plugin-poeblix = callPackage ./plugins/poetry-plugin-poeblix.nix { };
poeblix = callPackage ./plugins/poeblix.nix { };

and even before that it wasn't sorted alphabetically.

@hennk
Copy link
Contributor Author

hennk commented Mar 29, 2024

Why weren't the poetry maintainers pinged?

@dotlambda Sorry, this was my first PR, I'll keep that in mind in the future. Should I open a new PR for the changes you suggest?

@dotlambda
Copy link
Member

Should I open a new PR for the changes you suggest?

Yes please.

@dotlambda
Copy link
Member

I gave this a try since you don't seem to be making progress:

diff --git a/pkgs/tools/package-management/poetry/default.nix b/pkgs/tools/package-management/poetry/default.nix
index 415a2c0274d3..01745041f96b 100644
--- a/pkgs/tools/package-management/poetry/default.nix
+++ b/pkgs/tools/package-management/poetry/default.nix
@@ -27,10 +27,10 @@ let
   });
 
   plugins = ps: with ps; {
+    poeblix = callPackage ./plugins/poeblix.nix { };
     poetry-audit-plugin = callPackage ./plugins/poetry-audit-plugin.nix { };
     poetry-plugin-export = callPackage ./plugins/poetry-plugin-export.nix { };
     poetry-plugin-up = callPackage ./plugins/poetry-plugin-up.nix { };
-    poetry-plugin-poeblix = callPackage ./plugins/poetry-plugin-poeblix.nix { };
   };
 
   # selector is a function mapping pythonPackages to a list of plugins
diff --git a/pkgs/tools/package-management/poetry/plugins/poeblix.nix b/pkgs/tools/package-management/poetry/plugins/poeblix.nix
index 6e8cad3ef953..c73ca64d3a40 100644
--- a/pkgs/tools/package-management/poetry/plugins/poeblix.nix
+++ b/pkgs/tools/package-management/poetry/plugins/poeblix.nix
@@ -2,6 +2,9 @@
 , buildPythonPackage
 , fetchFromGitHub
 , poetry-core
+, poetry
+, pytestCheckHook
+, python
 }:
 
 buildPythonPackage rec {
@@ -17,19 +20,32 @@ buildPythonPackage rec {
   };
 
   postPatch = ''
-    sed -i '/poetry =/d' pyproject.toml
+    sed -i "/^addopts/d" pyproject.toml
   '';
 
-  nativeBuildInputs = [
+  build-system = [
     poetry-core
   ];
 
-  doCheck = false;
-  pythonImportsCheck = ["poeblix"];
+  buildInputs = [
+    poetry
+  ];
+
+  pythonImportsCheck = [ "poeblix" ];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+  ];
+
+  pytestFlagsArray = [
+    "--pspec" "test_walkthrough.py"
+  ];
+
+  #doCheck = with python; isPy37 || isPy39;
 
   meta = with lib; {
     changelog = "https://github.com/spoorn/poeblix/releases/tag/${src.rev}";
-    description = "Poetry Plugin that adds various features that extend the poetry command such as building wheel files with locked dependencies, and validations of wheel/docker containers";
+    description = "Poetry plugin for building wheel files with locked dependencies and validating wheel/docker containers";
     license = licenses.mit;
     homepage = "https://github.com/spoorn/poeblix";
     maintainers = with maintainers; [ hennk ];

It didn't work so let's revert this change for now.

@hennk
Copy link
Contributor Author

hennk commented Mar 31, 2024

The poeblix tests assume that the plugin is installed in poetry, already (see https://github.com/spoorn/poeblix/blob/main/README.md#development , the ./devtool bootstrap line installs poeblix into the currently installed poetry instance).

I don't know how to do this inside the check phase, maybe you have an idea?

@hennk
Copy link
Contributor Author

hennk commented Mar 31, 2024

I started a PR at #300432 to incorporate the changes you requested @dotlambda . Checks are still disabled, though, due to the problem mentioned above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants